package com.hsyt.pms.api.common;

import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.io.Serializable;

/**
 * @Description: TODO
 * @author wangze@hsyuntai.com
 * @date 2019年2月12日 下午2:45:51
 */
@Getter
@Setter
@EqualsAndHashCode
@NoArgsConstructor
public class CommonResult implements Serializable {

    private static final long serialVersionUID = 1757313404681564926L;

    /**
     * 是否成功
     */
    private Boolean success;

    /**
     * 网关码
     */
    private String code;

    /**
     * 网关码描述
     */
    private String msg;

    /**
     * 业务码
     */
    private String subCode;

    /**
     * 业务码描述
     */
    private String subMsg;

    private String body;

    public CommonResult(Boolean success, String code, String msg) {
        this.success = success;
        this.code = code;
        this.msg = msg;
    }

    public CommonResult(Boolean isSuccess, String code, String msg, String subCode, String subMsg) {
        this.success = isSuccess;
        this.code = code;
        this.msg = msg;
        this.subCode = subCode;
        this.subMsg = subMsg;
    }

    public boolean isSuccess() {
        return success;
    }
}
